
package com.joysuch.wwyt.datadump.biz.convertor;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import com.joysuch.wwyt.edu.enums.QuestionTypes;
import org.springframework.stereotype.Component;

/**
 * 题型
 */
@Component
public class ImportQuestionTypeConvertor implements FieldValueConvert<String, String> {

    @Override
    public String convert(Object bean, String value, DataDumpField dataField) {
        QuestionTypes q = QuestionTypes.findByName(value);
        return q == null ? null : q.getCode();
    }

}
